package com.zz.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class CustomizationBean {
    /**
     * 说明:
     * MEMBER-SERVICE-PROVIDER 目前有两个 Availability Zones
     * member-service-provider:10002 , member-service-provider:10000
     * 所以如果你还需要使用注解@LoadBalanced 赋予 RestTemplate 负载均衡的能力
    */
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
